<extend name="Common@Layout:layui-admin" />
<block name="title">
    <title>系统设置</title>
</block>
<block name="style">
    <style>
        .layui-main {
            padding: 10px;
        }
        
        .layui-form {
            padding-top: 10px;
        }
        
        .layui-form-label {
            width: 110px
        }
        
        .layui-input-block {
            margin-left: 140px;
            width: 300px;
        }
        
        .layui-tab-title li {
            font-size: 16px;
        }
        
        .page {
            text-align: center;
        }
        
        .search {
            width: 150px width: 45px
        }
        
        body {
            padding: 10px;
        }
        
        .yjc-title {
            color: #32c5d2!important;
            margin-left: 15px;
            margin-bottom: 8px;
            display: inline-block;
            font-size: 22px;
            line-height: 22px;
            color: #666;
        }
    </style>
</block>

<block name="main">
    <div class="yjc-title">文章列表</div>
    <div class="my-btn-box">

        <span class="fl" style="width：58px;line-height: 58px;padding-left:10px">
	        <!--<a class="layui-btn btn-add btn-default" onclick="open_iframe_dialog('{:U('edit')}','添加',['900px','700px'],1)" id="btn-add-article">添加</a>-->
	      	    <button class="layui-btn  layui-btn-danger  ajax-post shuaxin confirm yjc-del" target-form="validator_form" data-msg="确定批量删除？" data-url="/admin/article/artic_more_del">批量删除</button>
  				<a onclick="open_iframe_dialog('/admin/article/edit','添加文章',['900px','700px'],1)" class="layui-btn  layui-btn-normal">添加文章</a>

	    </span>
        <span class="fr">

            <form class="layui-form" action="{:U('index')}" method="get">
                <span class="layui-form-label" style="text-align:right">搜索条件：</span>

        <div class="layui-input-inline" style="width:100px;">
            <php>
                $types = array(0=>'分类筛选',3=>'最新动态',5=>'影响力',6=>'风采');
            </php>
            <select name="search_type" lay-verify="required">
                        <foreach name="types" item="vo" key="k">
                        <option value="{$k}" <if condition="$_GET['search_type'] eq $k ">selected</if>>{$vo}</option>
                        </foreach>
                    </select>
        </div>
        <div class="layui-input-inline" style="width:250px;">
            <input type="text" name="search_keyword" value="{$_GET['search_keyword']}" autocomplete="off" placeholder="请输入搜索条件" class="layui-input">
        </div>
        <button class="layui-btn mgl-20">查询</button>
        </form>
        <php>
            $conditionStr = ""; if($_GET['search_keyword']){ $conditionStr = "type=".$_GET['search_type']."&keyword=".$_GET['search_keyword']; }

        </php>
        </span>

    </div>
    <form class="validator_form">
        <div class="layui-form datashow" data-url="/Admin/Article/get_art_list" data-to-red="" data-condition="{$conditionStr}" data-p="1" data-row="10">
            <table class="layui-table">
                <!-- 控制对应的列宽度 -->
                <colgroup>
                    <col width="50">
                    <col>
                    <col>
                </colgroup>
                <!-- 表头部分 -->
                <thead>
                    <tr>
                        <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
                        <th>id</th>
                        <th>标题</th>
                        <th>作者</th>
                        <th>封面图</th>
                        <th>分类</th>
                        <th>发布时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <!-- 加载数据的位置 -->
                <tbody class="data"></tbody>
            </table>
            <!-- 用以插入分页结构的容器 -->
            <div class="page" id="page"></div>
            <!-- 数据模板，统一样式名为data-tpl -->
            <script class="data-tpl" type="text/html">
                {{# layui.each(d, function(index, item){ }}
                <tr>
                    <td><input type="checkbox" name="ids[]" value="{{item.id}}" lay-skin="primary">
                        <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
                    </td>
                    <td class="param-id">{{item.id}}</td>
                    <td class="param-title">{{item.title}} </td>
                    <td class="param-userline">{{item.userline}} </td>
                    <td class="param-cover"><img src="{{item.cover}}"> </td>
                    <td class="param-type">{{item.type}} </td>
                    <td class="param-dateline">{{item.dateline}} </td>
                    <td class="param-status">{{# if(item.state == 1){ }}<span style="color:green">正常</span> {{# } }} {{# if(item.state == 0){ }}<span style="color:orangered">锁定中 </span>{{# } }} </td>
                    <td class="param-caozuo">

                        <a onclick="open_iframe_dialog('/admin/article/edit/id/{{item.id}}','编辑文章',['900px','700px'],1)" class="layui-btn layui-btn-small layui-btn-normal">编辑</a> {{# if(item.state == 1){ }}<button class="layui-btn layui-btn-small layui-btn-warm  ajax-get shuaxin"
                            data-url="/admin/article/change_state/id/{{item.id}}">锁定</button> {{# } }} {{# if(item.state == 0){ }}<button class="layui-btn layui-btn-small  ajax-get shuaxin" data-url="/admin/article/change_state/id/{{item.id}}">还原</button>                        {{# } }}

                        <button class="layui-btn layui-btn-small layui-btn-danger mini_del" data-url="/admin/article/artic_del/ids/{{item.id}}">删除</button></td>
                    <!--  </td>-->
                </tr>
                {{# }); }} {{# if(d.length === 0){ }} --- No Data --- {{# } }}

            </script>
        </div>
    </form>
</block>


<block name="script">

    <script>
    </script>
</block>